﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using XCommunity.Web.UI;
using XCommunity.Forums.Views;

public partial class Forums_Presenters_PanelPresenter : System.Web.UI.UserControl
{
  protected void Page_Load( object sender, EventArgs e )
  {
  }


  public override void DataBind()
  {

    if ( this.GetView() is BoardFrameView )
      BoardExtension.Visible = true;

    base.DataBind();
  }


  protected override void DataBindChildren()
  {

    foreach ( PanelFrameView view in ( (PanelFrameView) this.GetView() ).ChildPanels )
    {

      var presenter = new Presenter( view );

      presenter.Controls.Add( LoadControl( "PanelPresenter.ascx" ) );

      ChildPanels.Controls.Add( presenter );

    }

    base.DataBindChildren();
  }


}
